package com.longway.common.kit;

import java.util.HashMap;
import java.util.Map;
 
public class ChineseNumberKit {
     
    private static final Map<String, String> NUMBER_MAPPING = new HashMap<String, String>();
    static {
        NUMBER_MAPPING.put("0", "零");
        NUMBER_MAPPING.put("1", "壹");
        NUMBER_MAPPING.put("2", "贰");
        NUMBER_MAPPING.put("3", "叁");
        NUMBER_MAPPING.put("4", "肆");
        NUMBER_MAPPING.put("5", "伍");
        NUMBER_MAPPING.put("6", "陆");
        NUMBER_MAPPING.put("7", "柒");
        NUMBER_MAPPING.put("8", "捌");
        NUMBER_MAPPING.put("9", "玖");
    }
 
    public static String getChineseNumber(String number) {
    	StringBuilder sb = new StringBuilder();
    	for(int i=0;i<number.length();i++)
    	{
    		char ch = number.charAt(i);
    		sb.append(NUMBER_MAPPING.get(String.valueOf(ch)));
    	}
        return sb.toString();
    }
 
    public static void main(String[] args) {
        System.out.println(getChineseNumber("8712"));
    }
 
}